import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * @Author YuanYuan
 * @Date 2022/10/7
 * @Time 15:48
 */
public class Demo11 {
    //使用Scanner进行读操作
    public static void main(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream("./bbb.txt");
        //InputStream是字节流,Scanner在InputStream包装出了一个字符流
        Scanner scanner = new Scanner(inputStream);
        while (scanner.hasNext()) {
            System.out.println(scanner.next());
        }
        inputStream.close();

    }
}
